package models;

import java.sql.ResultSet;
import java.sql.SQLException;

public class 
ReturnItemModel 
extends AbstractModel
{	public boolean
	insert(Integer retid, Integer upc, Integer quantity)
	{	try{
			ps = con.prepareStatement("INSERT INTO ReturnItem VALUES (?,?,?)");
			ps.setInt(1, retid);
			ps.setInt(2,upc);
			ps.setInt(3, quantity);
			return wrapUp();
		} catch(SQLException ex){ return registerException(ex); }
	}
	
	public boolean
	delete(Integer retid, Integer upc)
	{ 	try{
			ps = con.prepareStatement("DELETE FROM ReturnItem WHERE upc = ? AND retid = ?");
			ps.setInt(1,upc);
			ps.setInt(2,retid);
			return wrapUp();
		} catch(SQLException ex){ return registerException(ex); }
	}
	
	public ResultSet
	show()
	{ return super.show("ReturnItem"); }
}
